package com.zzw.springboot.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zzw.springboot.bean.Supplier;
import com.zzw.springboot.bean.SupplierCooperation;
import com.zzw.springboot.mapper.SupplierCooperationMapper;
import com.zzw.springboot.mapper.SupplierMapper;
import com.zzw.springboot.service.SupplierCooperationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SupplierCooperationServiceImpl extends ServiceImpl<SupplierCooperationMapper, SupplierCooperation> implements SupplierCooperationService {

    @Autowired
    private SupplierCooperationMapper cooperationMapper;

    @Override
    public void addCooperation(SupplierCooperation cooperation) {
        cooperationMapper.insertCooperation(cooperation);
    }

    @Override
    public void updateCooperation(SupplierCooperation cooperation) {
        cooperationMapper.updateCooperation(cooperation);
    }

    @Override
    public void deleteCooperation(Integer cooperationId) {
        cooperationMapper.deleteCooperation(cooperationId);
    }

    @Override
    public SupplierCooperation getCooperationById(Integer cooperationId) {
        return cooperationMapper.selectCooperationById(cooperationId);
    }

    @Override
    public List<SupplierCooperation> getCooperationsBySupplier(Integer supplierId) {
        return cooperationMapper.selectCooperationsBySupplier(supplierId);
    }

    @Override
    public List<SupplierCooperation> getCooperationList(SupplierCooperation cooperation) {
        return cooperationMapper.selectCooperationList(cooperation);
    }
}
